package edu.sctu.zhengsenwen.month201506.day20150611;

/**
 * Created by user15 on 2015/6/11.
 */
public class Test {


    String name;
    String sex;
    static int age;

    //构造方法
    public Test() {


        System.out.println("通过构造方法初始化name");

        name = "tom";
    }

    {
        //初始化块
        System.out.println("通过初始化快初始化sex");

        sex = "男";
    }

        //静态初始化模块
        static {
            System.out.println("通过静态初始化块初始化age");

            age = 20;
        }

    public void show() {
        System.out.println("姓名：" + name + "，性别：" + sex + "，年龄：" + age);
    }


    public static void main(String[] args) {


        Test test = new Test();

        test.show();

    }
}
